<template>
  <div>
    <title-panel />
    <van-cell>
      <div class="flex-between col-333333">
        <div class="m-r-10" style="width: 26%"><span style="color: #ff3b30">*</span>操作日期</div>
        <div class="line-text-out text-right" style="width: 68%">
          {{ dataAll.operationDate|dateFormat('YYYY-MM-DD') }}
        </div>
      </div>
    </van-cell>
    <van-cell>
      <div class="flex-between col-333333">
        <div class="m-r-10" style="width: 26%"><span style="color: #ff3b30">*</span>转入养殖区域</div>
        <div class="line-text-out text-right" style="width: 68%">
          {{ dataAll.cultureArea }}{{dataAll.physiologyStageShow}}
        </div>
      </div>
    </van-cell>

    <van-cell>
      <div class="flex-between col-333333">
        <div class="m-r-10" style="width: 26%"><span style="color: #ff3b30">*</span>当前天数</div>
        <div class="line-text-out text-right" style="width: 68%">
          {{ dataAll.currentDays }}
        </div>
      </div>
    </van-cell>
    <van-cell>
      <div class="flex-between col-333333" @click="viewEarLabel">
        <div class="m-r-10" style="width: 26%"><span style="color: #ff3b30">*</span>羊只数量(只)</div>
        <div class="line-text-out text-right leaveNum" style="width: 68%; padding-right: 60px">
          {{ dataAll.changeNum }}
        </div>
      </div>
    </van-cell>
  </div>
</template>
<script>
import {
  Form,
  Field,
  Calendar,
  RadioGroup,
  Radio,
  Dialog,
  Toast,
  DatetimePicker,
  Picker,
  Button,
  Icon,
  Cell,
  Popup,
  Image
} from 'vant'

import TitlePanel from '@/components/titlePanel'
import { getValue, setValue } from '@/utils/auth'
import { getHandle } from '@/api'
export default {
  components: {
    TitlePanel,
    [Form.name]: Form,
    [Field.name]: Field,
    [Calendar.name]: Calendar,
    [RadioGroup.name]: RadioGroup,
    [Radio.name]: Radio,
    [Picker.name]: Picker,
    [DatetimePicker.name]: DatetimePicker,
    [Button.name]: Button,
    [Icon.name]: Icon,
    [Popup.name]: Popup,
    [Toast.name]: Toast,
    [Cell.name]: Cell,
    [Dialog.Component.name]: Dialog.Component,
    [Image.name]: Image,
    [Dialog.name]: Dialog
  },
  data() {
    return {

      dataAll: {}

    }
  },
  created() {
    this.getViewData()
  },
  mounted() {},
  methods: {
    // 查看耳标数据
    viewEarLabel() {
      // 把我存起来的id起个别名再存起来,在公共的查看耳标vue文件中使用
      setValue('seeRecordId2', getValue('viewBreedAreaRecord-id'))
      // 跳转查看耳标公共vue页面
      this.$bridge.call('sheepSee')
    },
    // 查看页面数据请求
    getViewData() {
      getHandle(`/agri/api/yzbzh/breedAreaChange/queryDetail/${getValue('viewBreedAreaRecord-id')}`).then(res => {
        console.log(res)
        this.dataAll = res.data
      })
    }
  }
}
</script>
<style lang="scss" scoped>
[data-v-224e46c1] .van-cell {
  border-bottom: none;
}
.leaveNum {
  position: relative;
}
.leaveNum::after {
  content: '查看';
  position: absolute;
  font-size: 12px;
  top: 0;
  right: 0;
  width: 50px;
  height: 24px;
  text-align: center;
  border: 1px solid #37b5b5;
  color: #37b5b5;
  border-radius: 4px;
}
.van-cell {
  line-height: 40px;
}
.flex-between {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  line-height: 2em;
}
.m-r-10 {
  margin-right: 10px;
}
.line-text-out {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.text-right {
  text-align: right;
}
.text-center {
  text-align: center;
}
.col-1b1b {
  color: #1b1b1b;
}
.col-8686 {
  color: #868686;
}
::v-deep .van-cell {
  border-bottom: 1px solid #dbd8d8;
}
.imgstyle::after {
  content: '';
  width: 100px;
}
.footerImg {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: #37b5b5;
  > img {
    width: 22px;
    height: 22px;
  }
}
.shop .bottom {
  position: fixed;
  bottom: 0;
  height: 68px;
  width: 100%;
  box-sizing: border-box;
  background: #ffffff;
  padding: 8px 10px 8px 14px;
  box-shadow: 0px -2px 5px 0px rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.bthStyle {
  width: 56px;
  height: 20px;
  border-radius: 10px;
  border: 1px solid #2871fe;
}
.addbtn {
  width: 50px;
  height: 24px;
  font-size: 13px;
  padding: 0;
  margin-top: 2px;
}
</style>
